﻿// 作者: du白
// 邮箱: weichen0716@163.com

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebPrinter.Library
{
    public interface IPrinterClient
    {
        /// <summary>
        /// 打印小票。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="content">小票内容</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> PrintReceiptAsync(string printerSn, string content);

        /// <summary>
        /// 查询小票打印状态。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="orderId">订单号或任务ID</param>
        /// <returns>打印状态信息</returns>
        Task<PApiResult<string>> GetPrintStatusAsync(string printerSn, string orderId);

        /// <summary>
        /// 播放收银语音。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="text">要播放的语音内容</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> PlayPayInVoiceAsync(string printerSn, string text);

        /// <summary>
        /// 绑定打印机。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="printerKey">打印机密钥</param>
        /// <param name="printerName">打印机名称</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> AddPrinterAsync(string printerSn, string printerKey,string printerName);

        /// <summary>
        /// 修改打印机信息。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="newName">新的打印机名称</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> EditPrinterAsync(string printerSn, string newName);

        /// <summary>
        /// 解绑打印机。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> DeletePrinterAsync(string printerSn);

        /// <summary>
        /// 设置打印浓度。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="density">浓度值</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> SetDensityAsync(string printerSn, int density);

        /// <summary>
        /// 设置打印速度。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="speed">速度值</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> SetPrintSpeedAsync(string printerSn, int speed);

        /// <summary>
        /// 设置音量。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="volume">音量值</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> SetVolumeAsync(string printerSn, int volume);

        /// <summary>
        /// 查询打印机状态。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <returns>打印机状态信息</returns>
        Task<PApiResult<string>> GetDeviceStatusAsync(string printerSn);

        /// <summary>
        /// 清空设备待打印队列。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> CleanWaitingQueueAsync(string printerSn);

        /// <summary>
        /// 打印图片设置。
        /// </summary>
        /// <param name="printerSn">打印机序列号</param>
        /// <param name="imageData">图片数据</param>
        /// <returns>操作结果</returns>
        Task<PApiResult<bool>> SetImageAsync(string printerSn, byte[] imageData);
    }
}
